/*
 * Consulta_Principal.java
 *
 * Created on 23 de Junho de 2007, 15:36
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package org.jerm.Interface.JTable_Consulta;

import org.jerm.Conectividade.*;
import org.jerm.Interface.Principal;

import java.util.Vector;
import javax.swing.JTable;
import javax.swing.table.*;

/**
 *
 * @author ra044637
 */
public class Consulta_Principal extends JTable {
    
    private Principal principal = null;
    
    /** Creates a new instance of Consulta_Principal */
    public Consulta_Principal(Principal principal) {
        super();
        this.principal = principal;
    }
    
    public void Exibe(String SQL)
    {
        RetornoSQL result = principal.SGBD_ALVO.executaSQL(SQL, "query");
        
        DefaultTableModel modelo =  new DefaultTableModel(result.getValores(), result.getColunas());
        
        super.setModel(modelo);
    }
    
}
